package com.demo.security.config;

import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.security.crypto.factory.PasswordEncoderFactories;
import org.springframework.security.crypto.password.PasswordEncoder;

public class PasswordEncoderTest {

    public static void main(String[] args) {
        PasswordEncoder passwordEncoder =
                PasswordEncoderFactories.createDelegatingPasswordEncoder();

        System.out.println(passwordEncoder.encode("123456"));
        System.out.println(passwordEncoder.matches("abc", "{bcrypt}$2a$10$QaJB89TRgaNdFTXTzqOCFuYc7DcrBqGnRp8MWzW/kYYzyPaMf76Cm"));
    }
}
